

#ifndef SAR_KERNEL_VM_STATE_H
#define SAR_KERNEL_VM_STATE_H

#include <kernel/handle/handle.h>

#include "agent.h"
#include "hash.h"
#include "limits.h"

typedef struct STATE {
	vm_Agent *Agent;
	handle Caller;
	int *InstructionPointer;
	vm_Datum Registers [VM_REGS_SIZE];
} vm_State;

vm_State *vm_state_request (vm_Agent *_agent);
void vm_state_release (vm_State *_state);
int vm_state_pop (vm_State *_state, handle _queue);
int vm_state_push (const vm_State *_state, handle _queue);

int vm_state_resume (vm_State *_state, int _steps);

#endif
